<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of VMT_PlotXSContMultiPlot</title>
  <meta name="keywords" content="VMT_PlotXSContMultiPlot">
  <meta name="description" content="Currently not implemented">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
  <script type="text/javascript">
    if (top.frames.length == 0) { top.location = "../index.html"; };
  </script>
</head>
<body>
<a name="_top"></a>
<!-- menu.html VMT_4.0_dev -->
<h1>VMT_PlotXSContMultiPlot
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Currently not implemented</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function [z,A,V,zmin,zmax] = VMT_PlotXSContMultiPlot(z,A,V,var,exag) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Currently not implemented
 Plots contours for the variable 'var' within the
 mean cross section given by the structure V. IF data is not supplied, user
 will be prompted to load data (browse to data).

 Multiplot allows the user to plot multiple cross sections on the same
 plot. P.R. Jackson, 6-28-10  (NOT WORKING YET)

 (adapted from code by J. Czuba)

 P.R. Jackson, USGS, 12-10-08</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../matlabicon.gif)">
<li><a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>	Prompts the user to select preprocessed transect files output by</li></ul>
This function is called by:
<ul style="list-style-image:url(../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [z,A,V,zmin,zmax] = VMT_PlotXSContMultiPlot(z,A,V,var,exag)</a>
0002 <span class="comment">% Currently not implemented</span>
0003 <span class="comment">% Plots contours for the variable 'var' within the</span>
0004 <span class="comment">% mean cross section given by the structure V. IF data is not supplied, user</span>
0005 <span class="comment">% will be prompted to load data (browse to data).</span>
0006 <span class="comment">%</span>
0007 <span class="comment">% Multiplot allows the user to plot multiple cross sections on the same</span>
0008 <span class="comment">% plot. P.R. Jackson, 6-28-10  (NOT WORKING YET)</span>
0009 <span class="comment">%</span>
0010 <span class="comment">% (adapted from code by J. Czuba)</span>
0011 <span class="comment">%</span>
0012 <span class="comment">% P.R. Jackson, USGS, 12-10-08</span>
0013 
0014 
0015 
0016 disp([<span class="string">'Plotting Mean Cross Section Contour Plot: '</span> var])
0017 
0018 <span class="comment">%% User Input</span>
0019 
0020 <span class="comment">%exag=50;    %Vertical exaggeration</span>
0021 
0022 
0023 <span class="comment">%% Load the data if not supplied</span>
0024 <span class="keyword">if</span> isempty(z) &amp; isempty(A) &amp; isempty(V) 
0025     [zPathName,zFileName,zf] = <a href="VMT_SelectFiles.html" class="code" title="function [zPathName,zFileName,zf] = VMT_SelectFiles;">VMT_SelectFiles</a>;  <span class="comment">%Have the user select the preprocessed input files</span>
0026     eval([<span class="string">'load '</span> zPathName <span class="string">'\'</span> zFileName{1}]);
0027 <span class="keyword">end</span>
0028 
0029 
0030 <span class="comment">%% Plot contours</span>
0031 
0032 clvls = 60;
0033 
0034 <span class="comment">%Find the direction of primary discharge (flip if necessary)</span>
0035 binwidth  = diff(V.mcsDist,1,2);
0036 binwidth  = horzcat(binwidth(:,1), binwidth);
0037 binheight = diff(V.mcsDepth,1,1);
0038 binheight = vertcat(binheight, binheight(1,:));
0039 flux = nansum(nansum(V.u./100.*binwidth.*binheight)); <span class="comment">%Not a true measured discharge because of averaging, smoothing, etc. but close</span>
0040 
0041 <span class="comment">% if zerosecq</span>
0042 <span class="comment">%     pdmin = nanmin(nanmin(V.vp));</span>
0043 <span class="comment">%     pdmax = nanmax(nanmax(V.vp));</span>
0044 <span class="comment">% else</span>
0045 <span class="comment">%     pdmin = nanmin(nanmin(V.u));</span>
0046 <span class="comment">%     pdmax = nanmax(nanmax(V.u));</span>
0047 <span class="comment">% end</span>
0048 <span class="keyword">if</span> flux &lt; 0; <span class="comment">%abs(pdmin) &gt; abs(pdmax)</span>
0049     flipxs = 1;
0050 <span class="keyword">else</span>
0051     flipxs = 0;
0052 <span class="keyword">end</span>
0053 
0054 <span class="keyword">if</span> flipxs 
0055     disp([<span class="string">'Streamwise Flow Direction (Perp. to mean XS; deg) = '</span> num2str(V.phi - 180)])
0056     disp([<span class="string">'Primary Flow Direction (deg) = '</span> num2str(V.phisp - 180)])
0057 <span class="keyword">else</span>
0058     disp([<span class="string">'Streamwise Flow Direction (Perp. to mean XS; deg) = '</span> num2str(V.phi)])
0059     disp([<span class="string">'Primary Flow Direction (deg) = '</span> num2str(V.phisp)])
0060 <span class="keyword">end</span>
0061 disp([<span class="string">'Deviation from Streamwise Direction (deg) = '</span> num2str(V.alphasp)])
0062 
0063 <span class="keyword">switch</span> var
0064     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}  <span class="comment">%Plots the streamwise velocity</span>
0065         <span class="keyword">if</span> flipxs
0066             wtp=[<span class="string">'-V.uSmooth'</span>];
0067             zmin=floor(nanmin(nanmin(-V.uSmooth)));
0068             zmax=ceil(nanmax(nanmax(-V.uSmooth)));
0069         <span class="keyword">else</span>
0070             wtp=[<span class="string">'V.uSmooth'</span>];
0071             zmin=floor(nanmin(nanmin(V.uSmooth)));
0072             zmax=ceil(nanmax(nanmax(V.uSmooth)));
0073         <span class="keyword">end</span>
0074         zinc = (zmax - zmin) / clvls;
0075         zlevs = zmin:zinc:zmax;     
0076     <span class="keyword">case</span>{<span class="string">'transverse'</span>} <span class="comment">%Plots the transverse velocity</span>
0077         wtp=[<span class="string">'V.vSmooth'</span>];
0078         zmax=ceil(max(abs(nanmin(nanmin(V.vSmooth))),abs(nanmax(nanmax(V.vSmooth)))));
0079         zmin=-zmax;
0080         zinc = (zmax - zmin) / clvls;
0081         zlevs = zmin:zinc:zmax;
0082     <span class="keyword">case</span>{<span class="string">'vertical'</span>} <span class="comment">%Plots the vertical velocity</span>
0083         wtp=[<span class="string">'V.wSmooth'</span>];
0084         zmax=ceil(max(abs(nanmin(nanmin(V.wSmooth))),abs(nanmax(nanmax(V.wSmooth)))));
0085         zmin=-zmax;
0086         zinc = (zmax - zmin) / clvls;
0087         zlevs = zmin:zinc:zmax;
0088     <span class="keyword">case</span>{<span class="string">'mag'</span>} <span class="comment">%Plots the velocity magnitude</span>
0089         wtp=[<span class="string">'V.mcsMagSmooth'</span>];
0090         zmin=floor(nanmin(nanmin(V.mcsMagSmooth)));
0091         zmax=ceil(nanmax(nanmax(V.mcsMagSmooth)));
0092         zinc = (zmax - zmin) / clvls;
0093         zlevs = zmin:zinc:zmax;
0094     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}  <span class="comment">%Plots the primary velocity with zero secondary discharge definition</span>
0095         <span class="keyword">if</span> flipxs
0096             wtp=[<span class="string">'-V.vpSmooth'</span>];
0097             zmin=floor(nanmin(nanmin(-V.vpSmooth)));
0098             zmax=ceil(nanmax(nanmax(-V.vpSmooth)));
0099         <span class="keyword">else</span>
0100             wtp=[<span class="string">'V.vpSmooth'</span>];
0101             zmin=floor(nanmin(nanmin(V.vpSmooth)));
0102             zmax=ceil(nanmax(nanmax(V.vpSmooth)));
0103         <span class="keyword">end</span>
0104         zinc = (zmax - zmin) / clvls;
0105         zlevs = zmin:zinc:zmax;                  
0106     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>} <span class="comment">%Plots the secondary velocity with zero secondary discharge definition</span>
0107         wtp=[<span class="string">'V.vsSmooth'</span>];
0108         zmax=ceil(max(abs(nanmin(nanmin(V.vsSmooth))),abs(nanmax(nanmax(V.vsSmooth)))));
0109         zmin=-zmax;
0110         zinc = (zmax - zmin) / clvls;
0111         zlevs = zmin:zinc:zmax;
0112     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition</span>
0113 <span class="comment">%         wtp=['V.Roz.upSmooth'];</span>
0114 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));</span>
0115 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));</span>
0116         
0117         <span class="keyword">if</span> flipxs
0118             wtp=[<span class="string">'-V.Roz.upSmooth'</span>];  
0119             zmin=floor(nanmin(nanmin(-V.Roz.upSmooth)));
0120             zmax=ceil(nanmax(nanmax(-V.Roz.upSmooth)));
0121         <span class="keyword">else</span>
0122             wtp=[<span class="string">'V.Roz.upSmooth'</span>];
0123             zmin=floor(nanmin(nanmin(V.Roz.upSmooth)));
0124             zmax=ceil(nanmax(nanmax(V.Roz.upSmooth)));
0125         <span class="keyword">end</span>
0126         zinc = (zmax - zmin) / clvls;
0127         zlevs = zmin:zinc:zmax;                
0128     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition</span>
0129         wtp=[<span class="string">'V.Roz.usSmooth'</span>];
0130         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usSmooth))),abs(nanmax(nanmax(V.Roz.usSmooth)))));
0131         zmin=-zmax;
0132         zinc = (zmax - zmin) / clvls;
0133         zlevs = zmin:zinc:zmax;
0134     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (downstream component)</span>
0135 <span class="comment">%         wtp=['V.Roz.upxSmooth'];</span>
0136 <span class="comment">%         zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));</span>
0137 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));</span>
0138       
0139         <span class="keyword">if</span> flipxs
0140             wtp=[<span class="string">'-V.Roz.upxSmooth'</span>];  
0141             zmin=floor(nanmin(nanmin(-V.Roz.upxSmooth)));
0142             zmax=ceil(nanmax(nanmax(-V.Roz.upxSmooth)));
0143         <span class="keyword">else</span>
0144             wtp=[<span class="string">'V.Roz.upxSmooth'</span>];
0145             zmin=floor(nanmin(nanmin(V.Roz.upxSmooth)));
0146             zmax=ceil(nanmax(nanmax(V.Roz.upxSmooth)));
0147         <span class="keyword">end</span>
0148         zinc = (zmax - zmin) / clvls;
0149         zlevs = zmin:zinc:zmax; 
0150     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}  <span class="comment">%Plots the primary velocity with Rozovskii definition (cross-stream component)</span>
0151         wtp=[<span class="string">'V.Roz.upySmooth'</span>];
0152         zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));
0153         zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));
0154             
0155 <span class="comment">%         if flipxs</span>
0156 <span class="comment">%             wtp=['-V.Roz.upySmooth'];</span>
0157 <span class="comment">%             zmin=floor(nanmin(nanmin(-V.Roz.upySmooth)));</span>
0158 <span class="comment">%             zmax=ceil(nanmax(nanmax(-V.Roz.upySmooth)));</span>
0159 <span class="comment">%         else</span>
0160 <span class="comment">%             wtp=['V.Roz.upySmooth'];</span>
0161 <span class="comment">%             zmin=floor(nanmin(nanmin(V.Roz.upySmooth)));</span>
0162 <span class="comment">%             zmax=ceil(nanmax(nanmax(V.Roz.upySmooth)));</span>
0163 <span class="comment">%         end</span>
0164         zinc = (zmax - zmin) / clvls;
0165         zlevs = zmin:zinc:zmax;
0166     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (downstream component)</span>
0167         wtp=[<span class="string">'V.Roz.usxSmooth'</span>];
0168         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usxSmooth))),abs(nanmax(nanmax(V.Roz.usxSmooth)))));
0169         zmin=-zmax;
0170         zinc = (zmax - zmin) / clvls;
0171         zlevs = zmin:zinc:zmax;
0172     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>} <span class="comment">%Plots the secondary velocity with Rozovskii definition (cross-stream component)</span>
0173         wtp=[<span class="string">'V.Roz.usySmooth'</span>];
0174         zmax=ceil(max(abs(nanmin(nanmin(V.Roz.usySmooth))),abs(nanmax(nanmax(V.Roz.usySmooth)))));
0175         zmin=-zmax;
0176         zinc = (zmax - zmin) / clvls;
0177         zlevs = zmin:zinc:zmax;        
0178     <span class="keyword">case</span>{<span class="string">'backscatter'</span>} <span class="comment">%Plots the backscatter</span>
0179         wtp=[<span class="string">'V.mcsBackSmooth'</span>];
0180         zmin=floor(nanmin(nanmin(V.mcsBackSmooth)));
0181         zmax=ceil(nanmax(nanmax(V.mcsBackSmooth)));
0182         zinc = (zmax - zmin) / clvls;
0183         zlevs = zmin:zinc:zmax;
0184     <span class="keyword">case</span>{<span class="string">'flowangle'</span>} <span class="comment">%Plots the flow angle (ROZ)</span>
0185         wtp=[<span class="string">'V.Roz.theta_degSmooth'</span>];
0186         zmin=floor(nanmin(nanmin(V.Roz.theta_degSmooth)));
0187         zmax=ceil(nanmax(nanmax(V.Roz.theta_degSmooth)));
0188         zinc = (zmax - zmin) / clvls;
0189         zlevs = zmin:zinc:zmax;
0190 
0191 <span class="comment">%     case{'dirdevp'} %Plots the directional deviation from the primary velocity</span>
0192 <span class="comment">%         wtp=['V.mcsDirDevp'];</span>
0193 <span class="comment">%         %zmax=ceil(max(abs(nanmin(nanmin(V.mcsDirDevp))),abs(nanmax(nanmax(V.mcsDirDevp)))));</span>
0194 <span class="comment">%         %zmin=-zmax;</span>
0195 <span class="comment">%         zmin=floor(nanmin(nanmin(V.mcsDirDevp)));</span>
0196 <span class="comment">%         zmax=ceil(nanmax(nanmax(V.mcsDirDevp)));</span>
0197 <span class="comment">%         zinc = (zmax - zmin) / clvls;</span>
0198 <span class="comment">%         zlevs = zmin:zinc:zmax;</span>
0199 <span class="keyword">end</span>
0200 
0201         
0202 figure(3); clf
0203 contour(V.mcsDist,V.mcsDepth,eval(wtp(1,:)),zlevs,<span class="string">'Fill'</span>,<span class="string">'on'</span>,<span class="string">'Linestyle'</span>,<span class="string">'none'</span>); hold on
0204 plot(V.mcsDist(1,:),V.mcsBed,<span class="string">'w'</span>, <span class="string">'LineWidth'</span>,2); hold on
0205 
0206 <span class="keyword">switch</span> var
0207     <span class="keyword">case</span>{<span class="string">'streamwise'</span>}
0208         title(<span class="string">'Streamwise Velocity (cm/s)'</span>)
0209     <span class="keyword">case</span>{<span class="string">'transverse'</span>}
0210         title(<span class="string">'Transverse Velocity (cm/s)'</span>)
0211     <span class="keyword">case</span>{<span class="string">'vertical'</span>}
0212         title(<span class="string">'Vertical Velocity (cm/s)'</span>)
0213     <span class="keyword">case</span>{<span class="string">'mag'</span>}
0214         title(<span class="string">'Velocity Magnitude (Streamwise and Transverse) (cm/s)'</span>)
0215     <span class="keyword">case</span>{<span class="string">'primary_zsd'</span>}
0216         title(<span class="string">'Primary Velocity (Zero Secondary Discharge Definition) (cm/s)'</span>)
0217     <span class="keyword">case</span>{<span class="string">'secondary_zsd'</span>}
0218         title(<span class="string">'Secondary Velocity (Zero Secondary Discharge Definition) (cm/s)'</span>)
0219     <span class="keyword">case</span>{<span class="string">'primary_roz'</span>}
0220         title(<span class="string">'Primary Velocity (Rozovskii Definition) (cm/s)'</span>)
0221     <span class="keyword">case</span>{<span class="string">'secondary_roz'</span>}
0222         title(<span class="string">'Secondary Velocity (Rozovskii Definition) (cm/s)'</span>)   
0223     <span class="keyword">case</span>{<span class="string">'primary_roz_x'</span>}
0224         title(<span class="string">'Primary Velocity (Rozovskii Definition; Downstream Component) (cm/s)'</span>)    
0225     <span class="keyword">case</span>{<span class="string">'primary_roz_y'</span>}
0226         title(<span class="string">'Primary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)'</span>)        
0227     <span class="keyword">case</span>{<span class="string">'secondary_roz_x'</span>}
0228         title(<span class="string">'Secondary Velocity (Rozovskii Definition; Downstream Component) (cm/s)'</span>)        
0229     <span class="keyword">case</span>{<span class="string">'secondary_roz_y'</span>}
0230         title(<span class="string">'Secondary Velocity (Rozovskii Definition; Cross-Stream Component) (cm/s)'</span>)         
0231     <span class="keyword">case</span>{<span class="string">'backscatter'</span>}
0232         title(<span class="string">'Backscatter Intensity (dB)'</span>)
0233     <span class="keyword">case</span>{<span class="string">'flowangle'</span>}
0234         title(<span class="string">'Flow Angle (deg)'</span>)
0235 <span class="comment">%     case{'dirdevp'}</span>
0236 <span class="comment">%         title('Deviation from Primary Flow Direction (deg)')</span>
0237 <span class="keyword">end</span>
0238 hdl = colorbar; hold all
0239 caxis([zmin zmax])
0240 xlim([nanmin(nanmin(V.mcsDist)) nanmax(nanmax(V.mcsDist))])
0241 ylim([0 max(V.mcsBed)])
0242 set(gca,<span class="string">'YDir'</span>,<span class="string">'reverse'</span>)
0243 <span class="keyword">if</span> flipxs
0244     set(gca,<span class="string">'XDir'</span>,<span class="string">'reverse'</span>)
0245 <span class="keyword">end</span>
0246 ylabel(<span class="string">'Depth (m)'</span>,<span class="string">'Color'</span>,<span class="string">'w'</span>)
0247 xlabel(<span class="string">'Distance (m)'</span>,<span class="string">'Color'</span>,<span class="string">'w'</span>)
0248 set(gca,<span class="string">'DataAspectRatio'</span>,[exag 1 1],<span class="string">'PlotBoxAspectRatio'</span>,[exag 1 1])
0249 <span class="comment">%set(gcf,'Color','k');</span>
0250 set(gca,<span class="string">'FontSize'</span>,14)
0251 set(get(gca,<span class="string">'Title'</span>),<span class="string">'FontSize'</span>,14,<span class="string">'Color'</span>,<span class="string">'w'</span>) 
0252 <span class="comment">%set(gca,'Color','k')</span>
0253 set(gca,<span class="string">'XColor'</span>,<span class="string">'w'</span>)
0254 set(gca,<span class="string">'YColor'</span>,<span class="string">'w'</span>)
0255 set(gca,<span class="string">'ZColor'</span>,<span class="string">'w'</span>)
0256 set(gcf,<span class="string">'InvertHardCopy'</span>,<span class="string">'off'</span>)
0257 set(gcf,<span class="string">'Color'</span>,[0.2 0.2 0.2])
0258 set(gca,<span class="string">'Color'</span>,[0.3 0.3 0.3])
0259 
0260 
0261</pre></div>
<hr><address>Generated on Thu 21-Mar-2013 09:32:01 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>